const NodeEmail = require("nodemailer");
const transporter = NodeEmail.createTransport({
  service: "qq",
  port: 465,
  secureConnection: true,
  auth: { user: "40466911@qq.com", pass: "ijmltcmerddwcaib" }, // => { user: 你的邮箱, pass: 你的邮箱密码，开启POP3/SMTP的密码，如上图 }
});

module.exports = function(email) {
  new Promise((resolve, reject) => {
    transporter.sendMail({
      from: "40466911@qq.com", // 发送者邮箱地址
      to: email, // 接收这邮箱地址
      subject: "验证码", // 邮件主题
      html:
        '<div style="font-size: 30px;"><span style="font-size: 30px;">接头暗号:</span><span style="font-size:30px;color:blue;"> 1234</span></div>', // html模板
      text: "abcde", // 文本内容
    });
  });
};
